namespace RequirementAndBug.DAL.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class AddUserWithBug : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.REQRequirementREQUsers",
                c => new
                    {
                        REQRequirement_RequireID = c.Int(nullable: false),
                        REQUser_UserID = c.Int(nullable: false),
                    })
                .PrimaryKey(t => new { t.REQRequirement_RequireID, t.REQUser_UserID })
                .ForeignKey("dbo.REQRequirements", t => t.REQRequirement_RequireID, cascadeDelete: true)
                .ForeignKey("dbo.REQUsers", t => t.REQUser_UserID, cascadeDelete: true)
                .Index(t => t.REQRequirement_RequireID)
                .Index(t => t.REQUser_UserID);
            
        }
        
        public override void Down()
        {
            DropIndex("dbo.REQRequirementREQUsers", new[] { "REQUser_UserID" });
            DropIndex("dbo.REQRequirementREQUsers", new[] { "REQRequirement_RequireID" });
            DropForeignKey("dbo.REQRequirementREQUsers", "REQUser_UserID", "dbo.REQUsers");
            DropForeignKey("dbo.REQRequirementREQUsers", "REQRequirement_RequireID", "dbo.REQRequirements");
            DropTable("dbo.REQRequirementREQUsers");
        }
    }
}
